package com.googlecode.ppcool.common;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class ResourceInfo  implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2218054652465237170L;
	private byte[] id;
	private byte[] resourceId;
	private String resourceName;
	private long resourceSize;
	private int resourceType;
	private Map<BytesKey, Peer> peerSet = new HashMap<BytesKey, Peer>();

	public byte[] getId() {
		return id;
	}

	public void setId(byte[] id) {
		this.id = id;
	}

	public byte[] getResourceId() {
		return resourceId;
	}

	public void setResourceId(byte[] resourceId) {
		this.resourceId = resourceId;
	}

	public String getResourceName() {
		return resourceName;
	}

	public void setResourceName(String resourceName) {
		this.resourceName = resourceName;
	}

	public long getResourceSize() {
		return resourceSize;
	}

	public void setResourceSize(long resourceSize) {
		this.resourceSize = resourceSize;
	}

	public int getResourceType() {
		return resourceType;
	}

	public void setResourceType(int resourceType) {
		this.resourceType = resourceType;
	}

	public void addPeer(Peer peer) {
		peerSet.put(new BytesKey(peer.getPeerId()), peer);
	}

	public void removePeer(byte[] peerId) {
		peerSet.remove(new BytesKey(peerId));
	}
}
